package cn.zero.service;

import org.dom4j.Document;

import com.alibaba.fastjson.JSONObject;

import cn.zero.wechat.AccessTokenModel;

public interface WechatService {

    String getAppId();

    String getSignature(String appid, String nonce_str, String timestamp, String url);

    String getWechatAuthorizeUrl(String state, String url, boolean authorize) throws Exception;

    AccessTokenModel getAuthorizeAccessToken(String code);

    String getAccessToken(String appid);

    String getWechatAuthorizeInfo(String access_token, String openid) throws Exception;

    String getWechatInfo(String appid, String openid) throws Exception;

    /**
     * 微信接入校验
     * @param signature
     * @param timestamp
     * @param nonce
     * @return
     */
    boolean checkSignature(String signature, String timestamp, String nonce);

    /**
     * 处理微信公众号的请求
     * @param document
     * @return
     */
    String processRequest(String appid, Document document) throws Exception;


    /**
     * 获取微信公众号的标签
     * @return
     */
    JSONObject getTags();
    
    /**
     * 获取临时场景二维码链接
     * @param appid
     * @param sceneStr
     * @param seconds
     * @return
     */
    String getExpireQrcode(String appid, String sceneStr, long seconds);

}
